//
//  ReceiveTableViewCell.m
//  Shengzhuli
//
//  Created by 卡忙科技 on 16/8/7.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "ReceiveTableViewCell.h"

@interface ReceiveTableViewCell()
@property (weak, nonatomic) IBOutlet UILabel *receiveLab;
@property (weak, nonatomic) IBOutlet UILabel *tellLab;
@property (weak, nonatomic) IBOutlet UILabel *addressLab;
@property (weak, nonatomic) IBOutlet UIButton *checkBtn;
@property (weak, nonatomic) IBOutlet UILabel *tipsLab;

@end
@implementation ReceiveTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (IBAction)setDefaultClick:(UIButton *)btn
{
    if (btn.selected) return;
    btn.selected = !btn.selected;
    if ([self.delegate respondsToSelector:@selector(receiveTableViewCellChangeDefault:)]) {
        [self.delegate receiveTableViewCellChangeDefault:self.model];
    }
}

- (void)setModel:(AddressModel *)model
{
    _model = model;
    if (model.receivePersonPhone.length>0) {
        self.tipsLab.hidden = YES;
        self.receiveLab.text = model.receivePerson;
        self.tellLab.text = model.receivePersonPhone;
        self.addressLab.text = model.receiveAddress;
        self.checkBtn.selected = model.isDefault;
    }else{
        self.tipsLab.hidden = NO;
    }
}

@end
